<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>添加信息</title>
    <link rel="stylesheet" href="css/m_ind.css">
<script type="text/javascript">
  function check(){
    var ftc = document.getElementById("af");
    if(ftc.uname.value == ""){
      alert("请输入用户名");
    } else if (ftc.tid.value == "" || isNaN(ftc.tid.value)){
      alert("请输入时间id (3位正整数)");
    } else if (parseInt(ftc.tid.value) > 720 || parseInt(ftc.tid.value) < 108 || (parseInt(ftc.tid.value) % 100) > 20 || (parseInt(ftc.tid.value) % 100) < 8){
      alert("时间id格式不正确，举几个栗子：\n周六 13~14点： 613\n周一 20~21点： 120\n周日 9~10点： 709 ");
    } else {
      af.submit();
    }
  }
</script>
  </head>
  
  <body>
  <form action="Madd" method="post" id="af" class="codrops-demos">
    <input type="text" placeholder="&nbsp;&nbsp;请填写用户昵称" name="uname" />
    <input type="text" placeholder="&nbsp;&nbsp;请填写时间序列（如周日8~9点，填写708）" name="tid" />
    <a onClick="check();" >提交</a>
    <a href="master/index.jsp">返回</a>
</form>
<canvas id="canv"></canvas>
<script type="text/javascript" src="js/m_ind.js"></script>
  <h1 class="title">Add Information</h1>
  </body>
</html>
